/* src/App.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.app {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.app-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.app-header h1 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.app-header p {
  color: #7f8c8d;
}

.todo-container {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.todo-input {
  display: flex;
  margin-bottom: 20px;
}

.todo-input input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.todo-input input:focus {
  border-color: #3498db;
  outline: none;
}

.todo-input button {
  padding: 12px 20px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.3s;
}

.todo-input button:hover {
  background: #2980b9;
}

.todo-filters {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  gap: 10px;
}

.todo-filters button {
  padding: 8px 15px;
  background: #ecf0f1;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.todo-filters button.active,
.todo-filters button:hover {
  background: #3498db;
  color: white;
}

.todo-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 14px;
}

.todo-stats span {
  font-weight: bold;
  color: #3498db;
}

.todo-list {
  list-style: none;
}

.todo-list li {
  padding: 15px;
  margin-bottom: 10px;
  background: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all 0.3s;
  border: 1px solid #eee;
}

.todo-list li.completed {
  background: #f8fff8;
  border-color: #e1f7e1;
}

.todo-list li.completed .todo-text {
  text-decoration: line-through;
  color: #95a5a6;
}

.todo-list .empty-message {
  text-align: center;
  padding: 20px;
  color: #95a5a6;
  font-style: italic;
}

.todo-item {
  display: flex;
  align-items: center;
  width: 100%;
}

.todo-text {
  flex: 1;
  margin: 0 15px;
  word-break: break-word;
}

.todo-actions {
  display: flex;
  gap: 8px;
}

.todo-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.todo-actions button:first-child {
  background: #f39c12;
  color: white;
}

.todo-actions button:first-child:hover {
  background: #e67e22;
}

.todo-actions button:last-child {
  background: #e74c3c;
  color: white;
}

.todo-actions button:last-child:hover {
  background: #c0392b;
}

.edit-mode {
  display: flex;
  width: 100%;
  gap: 8px;
}

.edit-mode input {
  flex: 1;
  padding: 10px;
  border: 2px solid #3498db;
  border-radius: 4px;
  font-size: 16px;
}

.edit-mode button {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.edit-mode button:first-child {
  background: #2ecc71;
  color: white;
}

.edit-mode button:last-child {
  background: #95a5a6;
  color: white;
}

.app-footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  color: #7f8c8d;
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 600px) {
  .app {
    padding: 15px;
  }
  
  .todo-input {
    flex-direction: column;
  }
  
  .todo-input input {
    border-radius: 4px;
    margin-bottom: 10px;
  width: 100%;
  }
  
  .todo-input button {
    border-radius: 4px;
    width: 100%;
  }
  
  .edit-mode {
    flex-direction: column;
  }
  
  .todo-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .todo-text {
    margin: 10px 0;
  }
  
  .todo-actions {
    width: 100%;
    justify-content: flex-end;
  }
}